import sys

from PyQt5 import QtWidgets

from util_1 import Ui_MainWindow


class Login_MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self, parent=None):
        # 调用父类的初始化方法
        super(Login_MainWindow, self).__init__(parent)
        self.setupUi(self)

        #重新父类的setupUi方法

    def setupUi(self, Ui_MainWindow):
        super().setupUi(Ui_MainWindow)  #调用父类的setupUi()方法
        self.pushBtn.clicked.connect(self.showMessage)

        #自定义槽函数

    def showMessage(self):
        from PyQt5.QtWidgets import QMessageBox
        QMessageBox.information(None, '提示框', '欢迎来到98年代', QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)

    ui = Login_MainWindow()

    ui.show()
    sys.exit(app.exec_())
